use the shell in Linux to get yesterday, tomorrow or many days before the date time -- A- , the: -:xxblogjava-Expert Area Original http://www.blogjava.net/xzclog/archive/2015/12/08/428555.htmlTheme Shell Original address:
First, how does Perl get
Copy Code code as follows:
#!/usr/bin/perl-w
Use POSIX QW (strftime);
My $day = strftime ("%y%m%d", LocalTime (time-24*3600)); #获取昨天的日期
Second, in Linux on the man date-d parameters of the
topic: Resolving Hive's question of getting today, yesterday, tomorrow's date
Note: Due to the hive built-in function, there is no date function available to get yesterday and tomorrow, so you need to write a custom function to implement
1. Get
This example describes how PHP obtains yesterday, today, and tomorrow's date. Share to everyone for your reference, as follows:
PHP returns yesterday's Date function get_last_date () {$tomorrow = Mktime (0,0,0,date ("M"), Date ("D") -1,date ("Y")
This example describes how PHP gets yesterday, today, and tomorrow's date. Share to everyone for your reference, specific as follows:
PHP returns yesterday's date
function Get_last_date () {
$tomorrow = mktime (0,0,0,date ("M"), Date ("D")
: This article describes how to obtain the date of today, yesterday, and tomorrow for PHP. For more information about PHP tutorials, see. Directly go to the code and explain
"; Echo" yesterday: ". date (" Y-m-d ", strtotime ("-1 day ")),""; Echo"
Local Test Cases:
# there can be no spaces on either side of the equal sign, before the error has been out here
yesterday= ' date-d last-day +%y-%m-%d '
echo $yesterday
curday= ' Date +%y-%m-%d '
echo $curday
echo "Now time: ' Date ' +%y%m%d%T '"
JS get the day before yesterday, today, tomorrow, the day after Tomorrow (turn) JS gets the day before, yesterday, today, tomorrow, the day after tomorrow 2011-05-19 21:03 js Get Date: The day before yesterday, today, tomorrow, the day after
Another weekend, today is very interesting, the afternoon colleague to me a colleague of our company MSN address file, I imported a bit, is supposed to be my colleague, but suddenly there is a sister sent me a message, asked me who, of course, to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.